package Thread;
//static thread currentThread()
//获取运行当前线程的方法
public class ThreadAPI {
    public static void main(String[] args) {
        Thread main=Thread.currentThread();
        System.out.println("运行main方法的线程是:"+main);

        dosome();

        new Thread(){
          public void run(){
              dosome();
          }
        }.start();

    }

    public static void dosome(){
        Thread thread=Thread.currentThread();
        System.out.println("运行dome方法的线程是"+thread);
    }
}
